<?php

class BolaoCategoryPeer extends BaseBolaoCategoryPeer
{
  static function retrieveByNameSlug($name_slug)
  {
    // Mount name search string
    $name = str_replace('-', '_', $name_slug);

    $criteria = new Criteria();
    $criteria->add(BolaoCategoryPeer::NAME, $name, Criteria::LIKE);
    $criteria->setIgnoreCase(true);

    $result = BolaoCategoryPeer::doSelect($criteria);
    
    // If more than one result, return first result
    if (count($result) >= 1)
      return $result[0] ;
    else
      return NULL;
  }
}
